<?php

class AStaticModule extends AWebModule
{
	public function init()
	{
		$this->setImport(array(
			'AStatic.models.*',
			'AStatic.components.*',
		));

		$theme = 'adminArea'.DIRECTORY_SEPARATOR.'classic';
		Yii::app()->setTheme($theme);
		$this->setViewPath(Yii::app()->getTheme()->viewPath.DIRECTORY_SEPARATOR.$this->name);
	}

	public function beforeControllerAction($controller, $action)
	{
		if(parent::beforeControllerAction($controller, $action))
		{
			// this method is called before any module controller action is performed
			// you may place customized code here
			return true;
		}
		else
			return false;
	}

	public static function getMenuConfig(){
		return array(
			'name'=>'Статические страници',
			'sub'=>array(
				array(
					'name'=>'Список страниц',
					'url'=>'/adminArea/AStatic/item/list',
				),
				array(
					'name'=>'Добавить страницу',
					'url'=>'/adminArea/AStatic/item/update/id/0',
				),
				array(
					'name'=>'Список категорий',
					'url'=>'/adminArea/AStatic/category/list',
				),
				array(
					'name'=>'Добавить категорию',
					'url'=>'/adminArea/AStatic/category/update/id/0',
				),
			)
		);
	}
}
